package br.com.arquivo;
/**
 * 
 */


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author gfrancisco
 *
 */
public class LerArquivo {

	
	private static final Integer[] LAYOUT = {new Integer(2), 
											new Integer(9),									
											new Integer(7),									
											new Integer(8),									
											new Integer(9)};
	
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BufferedReader in = null;
		String line = "";
		String print = "";
		Integer beginIndex = 0;
		Integer endIndex = 0;
		System.out.println(LerArquivo.class.getSimpleName());
		
		try {
			in = new BufferedReader(new FileReader("c://A.txt"));
			
            while (in.ready()) {
                line = in.readLine();
                System.out.println("line:" + line.toString());
                beginIndex = 0;
                endIndex = 0;
                for (int i = 0; i < LAYOUT.length; i++) {
        			//System.out.println("beginIndex: " + beginIndex);
        			endIndex = (beginIndex+LAYOUT[i]);
        			//System.out.println("endIndex: " + endIndex);
        			print = line.substring(beginIndex, endIndex);
        			System.out.println(print);
        			beginIndex = beginIndex + LAYOUT[i];
        		}
              
                
            }
            in.close();
	    } catch (IOException e) {
	    	System.out.println(e.getMessage());
	    }
	    
		
	    

	}
	
	

}
